package com.woniuxy.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.UpdateProvider;

import com.woniuxy.pojo.Room;
import com.woniuxy.provider.RoomProvider;

public interface RoomMapper {
	
	@Select("select * from room where rtid=(select rtid from roomtype where rtname = #{roomType})")
	public List<Room> findByType(String roomType);
	
	@Select("select * from room")
	public List<Room> getAll();
	
	@UpdateProvider(type = RoomProvider.class, method = "updateRoom")
	public List<Room> updateR(Room room);
	
	@Delete("Delete  from room where rid=#{rid}")
	public int deleteR(int rid);

	@Insert("insert into room values(default,#{rtid},,#{rwindow},#{rfood},#{rspring},#{rprice},#{rstate},#{rmessage})")
	public int insertR(Room room);
	

}
